﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteContent.Master" Inherits="System.Web.Mvc.ViewPage<ProjectFitus.Models.NewsContent>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Brjostagjof.is | Fréttir | <%= Model.title %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Breyta frétt</h2>

    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>
        
        <fieldset>
            <legend>Breyta frétt</legend>
                        
            <div class="editor-label">
                <label for="isActive">Birta frétt:</label>
            </div>
            <div class="editor-field">
                <%: Html.CheckBoxFor(model => model.isActive) %>
                <%: Html.ValidationMessageFor(model => model.isActive) %>
            </div>
                        
            <div class="editor-label">
                <label for="title">Fyrirsögn:</label>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.title) %>
                <%: Html.ValidationMessageFor(model => model.title) %>
            </div>

            <div class="editor-label">
                <label for="contentText">Flokkur:</label>
            </div>
            <div class="editor-field">
            <select name="Cats" id="Cats">
                <%= ViewData["Cats"] %>
            </select>
            </div>
            
            <div class="editor-label">
                <label for="contentText">Efni fréttar:</label>
            </div>
            <div class="editor-field">
                <%: Html.TextAreaFor(model => model.contentText) %>
                <script type="text/javascript">CKEDITOR.replace('contentText');</script>
                <%: Html.ValidationMessageFor(model => model.contentText) %>
            </div>
            
            <div class="editor-label">
               <label for="introText">Útdráttur:</label>
            </div>
            <div class="editor-field">
                <%: Html.TextAreaFor(model => model.introText) %>
                <script type="text/javascript">CKEDITOR.replace('introText');</script>
                <%: Html.ValidationMessageFor(model => model.introText) %>
            </div>
                    
            <p>
                <input type="submit" value="Vista" />
            </p>

             <input type="hidden" id="newsId" name="newsId" value="<%: Model.id %>" />
            <input type="hidden" id="oldCategoryId" name="oldCategoryId" value="<%: ViewData["oldCatId"] %>" />
            <input type="hidden" id="dateCreated" name="dateCreated" value="<%: Model.dateCreated %>" />
            <input type="hidden" id="writtenByUserId" name="writtenByUserId" value="<%: Model.writtenByUserId %>" />
            <input type="hidden" id="viewCount" name="viewCount" value="<%: Model.viewCount %>" />
        </fieldset>

    <% } %>

    <div>
        <%: Html.ActionLink("Aftur í fréttalista", "Index") %>
    </div>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/ckeditor/ckeditor.js"></script>
</asp:Content>

